
#include "gtest/gtest.h"
#include <matrix.h>
GEO_ALG_USE_NAMESPACE
void print_matrix(const Matrix& mat) {
    std::cout << "{ " << std::endl;
    for (int i = 0; i < mat.row_count(); i++) {
        std::cout << "{ ";
        for (int j = 0; j < mat.col_count(); j++) {
            std::cout << mat[i][j] << " ";
        }
        std::cout << " }," << std::endl;
    }
    std::cout << " }," << std::endl;
}

TEST(MatrixTest, matrix_opt) {
    Matrix m4 = { { 1, 2, 3 },
        { 4, 5, 6 }
    };
    Matrix m5 = { { 1, 4 }, { 2, 5 }, { 3, 6 } };

    Matrix m6 = m4 * m5;
    Matrix m7 = m5 * m4;

    print_matrix(m5);
    print_matrix(m6);
    print_matrix(m7);

    Matrix m8 = { {14, 32}, {32, 77} };
    Matrix m9 = { {17, 22, 27}, {22, 29, 36}, {27, 36, 45} };
    ASSERT_EQ(m6, m8);
    ASSERT_EQ(m7, m9);
}